package com.belf.web.controller.console;

import com.belf.common.annotation.Log;
import com.belf.common.core.controller.BaseController;
import com.belf.common.core.domain.AjaxResult;
import com.belf.common.enums.BusinessType;
import com.belf.console.domain.DataTaskLog;
import com.belf.console.service.IDataTaskJobManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 同步任务Controller
 * 
 * @author belf
 * @date 2024-06-20
 */
@RestController
@RequestMapping("/console/taskJobManage")
public class TaskJobManageController extends BaseController
{
    @Autowired
    private IDataTaskJobManageService taskJobManageService;

    /**
     * 执行评估任务
     */
    @Log(title = "校验任务", businessType = BusinessType.UPDATE)
    @PostMapping("/taskList")
    public AjaxResult taskList()
    {
        return taskJobManageService.taskList();
    }

    /**
     * 执行评估任务
     */
    @Log(title = "校验任务", businessType = BusinessType.UPDATE)
    @PostMapping("/taskStop")
    public AjaxResult taskStop(@RequestBody DataTaskLog dataTaskLog)
    {
        return taskJobManageService.taskStop(dataTaskLog.getId());
    }
}
